#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int a = 10;
    int b = 20;
    auto lambda = [a, b] (int c , int d) mutable throw(int) -> int {
        if (c == 0 && d== 0) {
            throw(10);
        }
        a++;
        b++;
        int result = a + b +c + d;
        return result;
    };
    try {
        cout << "lambda = " << lambda(3, 5) << endl;
    } catch(int error) {
        cout << "Error: " << error << endl;
    }

    try {
        cout << "lambda = " << lambda(0, 0) << endl;
    } catch(int error) {
        cout << "Error: " << error << endl;
    }

    return 0;
}